﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Xml.Linq;
using AspNet.StarterKits.Classifieds.BusinessLogicLayer;
using AspNet.StarterKits.Classifieds.Web;

public partial class ajaxSearch : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = -1;
        //required to keep the page from being cached on the client's browser        
        Response.ContentType = "text/plain";
        int adId =0;
        try
        {
            adId = int.Parse(Request.QueryString["q"]);
        }
        catch {
            Response.Write("Incorrect parameter");
        }
        AdsDataComponent.AdsRow ad = AdsDB.GetAdById(adId);
        
        Response.Write(OutputFormatting.SubString(ad.Description,500));

       Response.End();
    }
}
